#include <bits/stdc++.h>
#ifndef DEBUG
#define debug
#endif
using namespace std;
using i64 = int64_t;

const int mod = 998244353;
int main() {
  cin.tie(0)->sync_with_stdio(0);
  int n, m;
  cin >> n >> m;
  n *= 2;
  vector<vector<int>> friends(n + 1, vector<int>(n + 1));
  for (int i = 1; i <= m; i ++) {
    int u, v;
    cin >> u >> v;
    friends[u][v] = friends[v][u] = 1;
  }
  vector<vector<i64>> C(n + 1, vector<i64>(n + 1));
  for (int i = 0; i <= n; i ++) {
    for (int j = 0; j <= i; j ++) {
      if (j == 0 || j == i) C[i][j] = 1;
      else C[i][j] = (C[i - 1][j - 1] + C[i - 1][j]) % mod;
    }
  }
  vector<vector<array<i64, 2>>> dp(n + 1, vector<array<i64, 2>>(n + 1));
  for (int l = n; l >= 1; l --) {
    if (l + 1 <= n && friends[l][l + 1]) dp[l][l + 1][0] = dp[l][l + 1][1] = 1;
    for (int r = l + 3; r <= n; r += 2) {
      for (int k = l + 1; k < r; k += 2) {
        int pair = (r - l + 1) / 2, left = (k - l + 1) / 2;
        dp[l][r][0] = (dp[l][r][0] + dp[l][k][1] * dp[k + 1][r][0] % mod * C[pair][left]) % mod;
      }
      if (friends[l][r]) {
        dp[l][r][0] = (dp[l][r][0] + dp[l + 1][r - 1][0]) % mod;
        dp[l][r][1] = (dp[l][r][1] + dp[l + 1][r - 1][0]) % mod;
      }
    }
  }
  cout << dp[1][n][0] << endl;
}